﻿using System;

using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;

namespace CodeStream.Testing.WebAutomation.InternetExplorer
{
    internal class UIDevDisableMenu : WinMenu
    {
        private readonly Lazy<WinMenuItem> m_script;

        public UIDevDisableMenu(UITestControl searchLimitContainer) :
            base(searchLimitContainer)
        {
            SearchProperties[WinMenu.PropertyNames.Name] = "Context";

            m_script = new Lazy<WinMenuItem>(new Func<WinMenuItem>(() =>
            {
                var result = new WinMenuItem(this);
                result.SearchProperties[WinMenuItem.PropertyNames.Name] = "Script";
                return result;
            }));
        }

        public WinMenuItem Script
        {
            get { return m_script.Value; }
        }
    }

}
